package com.smsc.headend.connector.service;


import com.smsc.headend.connector.bo.TaskContext;
import com.smsc.headend.connector.netty.SyncFuture;
import com.smsc.headend.module.asset.entity.ComEntity;
import com.smsc.headend.module.data.dto.ClearLocalCacheDto;
import io.netty.channel.Channel;

public interface TerminalChannelService {
    String getNetAddressByTerminal(ComEntity terminal);

    ComEntity getTerminalByNetAddress(String netAddress);

    void addTerminalNetAddress(ComEntity terminal, Channel channel);

    byte[] getSyncResponse(Channel channel, Integer getTimeout, String deviceAddress) throws InterruptedException;

    SyncFuture getFutureSync(String netAddress, String deviceAddress);

    TaskContext getTaskContext(String netAddress, String meterNo, Long termId);

    void putNetAddressTaskContext(String netAddress, TaskContext taskContext);

    void closeAnonyChannel(String moduleSn);

    void setChannelLastSendContext(String netAddress, TaskContext context);

    TaskContext getChannelLastSendContext(String netAddress);

    void removeChannelLastContext(String netAddress);

    ComEntity getTerminalById(Long terminalId);

    void checkOfflineComEntity();

    boolean isTerminalInCurrentNode(Long comId);

    void addReceiveRecord(ComEntity com);

    void disconnectDeprecatedChannel(String moduleSN, String loginCode);

    void clearComEntityCacheById(ClearLocalCacheDto comId);
}
